%%%-------------------------------------------------------------------
%%% @author admin
%%% @copyright (C) 2022, <COMPANY>
%%% @doc
%%%
%%% @end
%%% Created : 20. 六月 2022 17:45
%%%-------------------------------------------------------------------
-module(account).
-author("admin").

-include("account.hrl").

%% API
-export([
    init/2
]).


init(AccountId, Pid) ->
    case db_load:load(account, AccountId) of
        {ok, Account = #account{}} ->
            {ok, Account#account{pid = Pid}};
        Err -> throw(Err)
    end.